class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.w: D = None
        self.v: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.u: A = None
        self.t: E = None
        self.z: F = 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.x: E = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
e = C("e")
f = D("f")
k = E("k")
j = F("j")
h = D("h")

c.x = k
c.q = e
c.w = h
c.p = h
c.v = j
b.x = c
b.u = c
b.o = e
b.t = k
b.z = j
e.z = f
f.x = k
k.y = c
k.q = b
k.t = j
j.w = b
j.u = f
j.s = k
h.x = k
assert k.y.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.w: D = None
        self.v: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.u: A = None
        self.t: E = None
        self.z: F = 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.x: E = None
        self.txt = txt

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

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

c = A("c")
b = B("b")
e = C("e")
f = D("f")
k = E("k")
j = F("j")
h = D("h")

c.x = k
c.q = e
c.w = h
c.p = h
c.v = j
b.x = c
b.u = c
b.o = e
b.t = k
b.z = j
e.z = f
f.x = k
k.y = c
k.q = b
k.t = j
j.w = b
j.u = f
j.s = k
h.x = k
assert k.y.x.q.txt == "b"