class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

d = A("d")
i = B("i")
j = C("j")
c = D("c")
g = E("g")
l = F("l")
k = C("k")

d.o = g
d.u = g
d.w = g
i.v = g
i.p = g
j.x = k
j.w = k
j.z = c
j.v = g
c.y = l
g.y = c
g.x = i
g.p = i
g.o = l
l.p = d
k.x = j
k.w = j
k.z = c
k.v = g
assert c.y.p.o.y.y.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

d = A("d")
i = B("i")
j = C("j")
c = D("c")
g = E("g")
l = F("l")
k = C("k")

d.o = g
d.u = g
d.w = g
i.v = g
i.p = g
j.x = k
j.w = k
j.z = c
j.v = g
c.y = l
g.y = c
g.x = i
g.p = i
g.o = l
l.p = d
k.x = j
k.w = j
k.z = c
k.v = g
assert c.y.p.o.y.y.p.u.txt == "g"