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

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

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

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

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

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

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

i.y = g
i.r = m
i.p = m
i.z = m
b.v = g
b.t = e
b.x = e
b.y = l
b.s = l
b.p = m
m.u = g
l.y = g
l.t = i
g.p = m
e.u = b
assert b.y.t.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

i.y = g
i.r = m
i.p = m
i.z = m
b.v = g
b.t = e
b.x = e
b.y = l
b.s = l
b.p = m
m.u = g
l.y = g
l.t = i
g.p = m
e.u = b
assert b.y.t.y.p.txt == "m"