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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

l = A("l")
g = B("g")
i = C("i")
f = D("f")
b = E("b")
m = F("m")
j = B("j")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

l = A("l")
g = B("g")
i = C("i")
f = D("f")
b = E("b")
m = F("m")
j = B("j")

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