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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

j.t = l
j.r = l
j.w = l
e.y = j
e.s = l
e.z = b
c.z = b
b.z = i
b.t = g
h.y = e
h.x = e
h.w = b
h.r = b
h.u = i
g.t = j
g.z = b
l.z = i
l.t = g
i.y = e
i.x = e
i.w = l
i.r = l
i.u = h
assert j.t.t.z.txt == "b"