class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.z: A = None
        self.o: D = None
        self.v: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.q: D = None
        self.v: E = None
        self.x: D = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: C = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

n = A("n")
d = B("d")
k = C("k")
m = D("m")
i = E("i")
b = F("b")
j = G("j")
f = D("f")
c = A("c")
l = B("l")

n.w = i
n.y = c
n.p = c
n.x = k
d.x = j
d.t = k
d.r = k
d.z = n
d.o = m
d.v = f
k.o = j
k.u = j
k.z = i
m.o = c
m.u = j
m.q = f
m.x = f
m.v = i
m.t = d
i.x = m
b.y = k
b.q = k
b.p = i
b.t = m
j.p = b
f.o = c
f.u = j
f.q = m
f.x = m
f.v = i
f.t = d
c.w = i
c.y = n
c.p = n
c.x = k
l.x = j
l.t = k
l.r = k
l.z = n
l.o = f
l.v = f
assert c.p.w.x.u.p.y.u.p.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.p: A = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.z: A = None
        self.o: D = None
        self.v: D = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: G = None
        self.q: D = None
        self.v: E = None
        self.x: D = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: C = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

n = A("n")
d = B("d")
k = C("k")
m = D("m")
i = E("i")
b = F("b")
j = G("j")
f = D("f")
c = A("c")
l = B("l")

n.w = i
n.y = c
n.p = c
n.x = k
d.x = j
d.t = k
d.r = k
d.z = n
d.o = m
d.v = f
k.o = j
k.u = j
k.z = i
m.o = c
m.u = j
m.q = f
m.x = f
m.v = i
m.t = d
i.x = m
b.y = k
b.q = k
b.p = i
b.t = m
j.p = b
f.o = c
f.u = j
f.q = m
f.x = m
f.v = i
f.t = d
c.w = i
c.y = n
c.p = n
c.x = k
l.x = j
l.t = k
l.r = k
l.z = n
l.o = f
l.v = f
assert c.p.w.x.u.p.y.u.p.t.t.txt == "d"