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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.r: C = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
i = C("i")
l = D("l")
b = E("b")
c = F("c")

h.r = b
h.y = k
k.z = c
k.x = c
i.s = k
i.r = c
i.z = h
i.y = h
i.u = b
i.t = b
l.t = c
b.q = l
b.z = l
b.o = l
b.r = i
b.y = c
c.s = h
c.u = l
assert k.x.s.r.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.r: C = None
        self.y: F = None
        self.o: D = None
        self.txt = txt

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

h = A("h")
k = B("k")
i = C("i")
l = D("l")
b = E("b")
c = F("c")

h.r = b
h.y = k
k.z = c
k.x = c
i.s = k
i.r = c
i.z = h
i.y = h
i.u = b
i.t = b
l.t = c
b.q = l
b.z = l
b.o = l
b.r = i
b.y = c
c.s = h
c.u = l
assert k.x.s.r.q.t.txt == "c"