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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.u: E = None
        self.y: D = None
        self.z: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.txt = txt

l = A("l")
c = B("c")
n = C("n")
i = D("i")
e = E("e")
h = F("h")
d = D("d")
m = F("m")
k = F("k")
f = B("f")

l.w = f
l.p = f
c.v = l
c.q = l
c.x = e
c.u = e
c.y = i
c.z = h
n.u = c
n.o = l
n.s = f
n.w = d
i.v = d
e.o = l
e.z = f
h.x = d
h.r = e
d.v = i
m.x = i
m.r = e
k.x = d
k.r = e
f.v = l
f.q = l
f.x = e
f.u = e
f.y = i
f.z = h
assert e.o.p.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.u: E = None
        self.y: D = None
        self.z: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.txt = txt

l = A("l")
c = B("c")
n = C("n")
i = D("i")
e = E("e")
h = F("h")
d = D("d")
m = F("m")
k = F("k")
f = B("f")

l.w = f
l.p = f
c.v = l
c.q = l
c.x = e
c.u = e
c.y = i
c.z = h
n.u = c
n.o = l
n.s = f
n.w = d
i.v = d
e.o = l
e.z = f
h.x = d
h.r = e
d.v = i
m.x = i
m.r = e
k.x = d
k.r = e
f.v = l
f.q = l
f.x = e
f.u = e
f.y = i
f.z = h
assert e.o.p.z.r.z.txt == "f"