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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.x: D = None
        self.z: F = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
b = C("b")
n = D("n")
k = E("k")
i = F("i")
f = A("f")
e = F("e")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.x: D = None
        self.z: F = None
        self.p: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.z: C = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
b = C("b")
n = D("n")
k = E("k")
i = F("i")
f = A("f")
e = F("e")

l.x = f
g.o = n
g.s = n
g.x = n
g.z = i
g.p = f
b.q = n
b.x = i
n.w = b
n.z = b
n.q = i
k.p = e
k.r = b
i.u = e
i.v = b
i.y = b
f.x = l
e.u = i
e.v = b
e.y = b
assert b.x.u.v.q.q.y.txt == "b"