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

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

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

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

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

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

l = A("l")
g = B("g")
h = C("h")
c = D("c")
a = E("a")
k = F("k")

l.t = h
l.o = g
g.o = c
g.y = l
g.x = a
h.p = k
h.t = k
h.x = a
h.u = a
c.t = g
c.z = h
c.v = h
a.z = k
a.x = l
k.o = h
k.t = h
k.w = l
k.v = l
k.u = c
k.q = c
assert c.t.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

l = A("l")
g = B("g")
h = C("h")
c = D("c")
a = E("a")
k = F("k")

l.t = h
l.o = g
g.o = c
g.y = l
g.x = a
h.p = k
h.t = k
h.x = a
h.u = a
c.t = g
c.z = h
c.v = h
a.z = k
a.x = l
k.o = h
k.t = h
k.w = l
k.v = l
k.u = c
k.q = c
assert c.t.y.o.txt == "g"