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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.r: F = None
        self.z: C = None
        self.s: E = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.t: B = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

j = A("j")
g = B("g")
a = C("a")
b = D("b")
e = E("e")
i = F("i")
h = B("h")
c = D("c")
n = B("n")
d = A("d")

j.y = e
g.o = n
g.y = a
a.t = c
a.q = i
b.x = c
b.q = h
b.r = i
b.w = i
b.z = a
b.s = e
e.x = d
e.v = a
e.t = h
e.p = j
e.q = g
i.z = h
i.x = g
i.v = g
h.o = g
h.y = a
c.x = b
c.q = g
c.r = i
c.w = i
c.z = a
c.s = e
n.o = g
n.y = a
d.y = e
assert h.y.t.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.r: F = None
        self.z: C = None
        self.s: E = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.t: B = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

j = A("j")
g = B("g")
a = C("a")
b = D("b")
e = E("e")
i = F("i")
h = B("h")
c = D("c")
n = B("n")
d = A("d")

j.y = e
g.o = n
g.y = a
a.t = c
a.q = i
b.x = c
b.q = h
b.r = i
b.w = i
b.z = a
b.s = e
e.x = d
e.v = a
e.t = h
e.p = j
e.q = g
i.z = h
i.x = g
i.v = g
h.o = g
h.y = a
c.x = b
c.q = g
c.r = i
c.w = i
c.z = a
c.s = e
n.o = g
n.y = a
d.y = e
assert h.y.t.x.x.txt == "c"