class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.s: H = None
        self.o: B = None
        self.q: H = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: A = None
        self.x: F = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: D = None
        self.w: H = None
        self.o: H = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: A = None
        self.z: D = None
        self.x: B = None
        self.q: D = None
        self.o: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

i = A("i")
b = B("b")
c = C("c")
m = D("m")
g = E("g")
a = F("a")
j = G("j")
f = H("f")
d = F("d")

i.r = b
i.o = b
i.p = d
i.s = f
i.q = f
i.y = c
b.r = j
b.y = i
b.x = d
b.o = m
b.t = a
c.y = j
c.p = m
c.w = f
c.o = f
c.r = g
c.z = d
m.y = b
m.q = b
m.s = c
g.u = c
g.v = i
g.x = m
a.p = f
a.u = b
a.q = c
j.t = g
j.o = g
j.y = i
j.z = m
j.q = m
j.x = b
j.r = f
f.q = i
d.p = f
d.u = b
d.q = c
assert c.y.x.x.u.t.p.q.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.s: H = None
        self.o: B = None
        self.q: H = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: A = None
        self.x: F = None
        self.o: D = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: D = None
        self.w: H = None
        self.o: H = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: B = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: A = None
        self.z: D = None
        self.x: B = None
        self.q: D = None
        self.o: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

i = A("i")
b = B("b")
c = C("c")
m = D("m")
g = E("g")
a = F("a")
j = G("j")
f = H("f")
d = F("d")

i.r = b
i.o = b
i.p = d
i.s = f
i.q = f
i.y = c
b.r = j
b.y = i
b.x = d
b.o = m
b.t = a
c.y = j
c.p = m
c.w = f
c.o = f
c.r = g
c.z = d
m.y = b
m.q = b
m.s = c
g.u = c
g.v = i
g.x = m
a.p = f
a.u = b
a.q = c
j.t = g
j.o = g
j.y = i
j.z = m
j.q = m
j.x = b
j.r = f
f.q = i
d.p = f
d.u = b
d.q = c
assert c.y.x.x.u.t.p.q.y.o.txt == "f"