class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.w: C = None
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.z: B = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
k = C("k")
d = D("d")
g = E("g")
j = F("j")
m = D("m")
b = C("b")

l.x = j
l.q = j
l.w = b
l.r = b
l.z = g
e.p = l
e.r = j
e.z = j
k.s = g
k.q = g
k.w = b
k.z = e
k.t = e
d.s = l
d.v = e
d.q = m
g.t = e
j.x = e
j.z = l
j.s = l
j.v = g
m.s = l
m.v = e
m.q = d
b.s = g
b.q = g
b.w = k
b.z = e
b.t = e
assert d.v.p.w.q.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: F = None
        self.w: C = None
        self.z: E = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.z: B = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
k = C("k")
d = D("d")
g = E("g")
j = F("j")
m = D("m")
b = C("b")

l.x = j
l.q = j
l.w = b
l.r = b
l.z = g
e.p = l
e.r = j
e.z = j
k.s = g
k.q = g
k.w = b
k.z = e
k.t = e
d.s = l
d.v = e
d.q = m
g.t = e
j.x = e
j.z = l
j.s = l
j.v = g
m.s = l
m.v = e
m.q = d
b.s = g
b.q = g
b.w = k
b.z = e
b.t = e
assert d.v.p.w.q.t.p.txt == "l"