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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

b.o = g
g.x = m
g.u = m
g.t = i
g.s = b
g.z = b
c.x = j
c.p = j
j.v = b
j.u = c
j.s = c
j.p = g
i.r = g
i.o = g
i.y = j
i.s = j
i.w = b
i.u = m
m.y = c
assert m.y.p.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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