class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.w: F = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.w: F = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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