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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.p: A = None
        self.q: B = None
        self.t: E = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
f = C("f")
b = D("b")
d = E("d")
m = F("m")
i = C("i")
a = D("a")
l = A("l")

g.u = a
g.q = d
g.y = l
g.z = n
n.w = d
n.x = b
f.v = i
b.v = a
b.w = n
b.q = n
b.p = g
b.t = d
d.p = g
d.u = m
m.v = d
m.r = d
m.q = d
i.v = f
a.v = b
a.w = n
a.q = n
a.p = g
a.t = d
l.u = a
l.q = d
l.y = g
l.z = n
assert a.v.p.q.u.q.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.y: A = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.p: A = None
        self.q: B = None
        self.t: E = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
f = C("f")
b = D("b")
d = E("d")
m = F("m")
i = C("i")
a = D("a")
l = A("l")

g.u = a
g.q = d
g.y = l
g.z = n
n.w = d
n.x = b
f.v = i
b.v = a
b.w = n
b.q = n
b.p = g
b.t = d
d.p = g
d.u = m
m.v = d
m.r = d
m.q = d
i.v = f
a.v = b
a.w = n
a.q = n
a.p = g
a.t = d
l.u = a
l.q = d
l.y = g
l.z = n
assert a.v.p.q.u.q.u.r.txt == "d"