class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.z: D = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.z: D = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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