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

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

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

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

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

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

n = A("n")
a = B("a")
j = C("j")
g = D("g")
e = E("e")
d = F("d")
k = E("k")

n.x = e
n.t = j
n.w = g
n.u = g
n.r = d
a.y = n
a.x = d
a.z = d
a.u = k
a.o = g
j.p = a
g.y = n
g.v = n
g.u = k
e.u = a
e.v = d
e.z = d
e.t = n
d.r = a
d.v = n
k.u = a
k.v = d
k.z = d
k.t = n
assert e.u.o.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.w: D = None
        self.r: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

n = A("n")
a = B("a")
j = C("j")
g = D("g")
e = E("e")
d = F("d")
k = E("k")

n.x = e
n.t = j
n.w = g
n.u = g
n.r = d
a.y = n
a.x = d
a.z = d
a.u = k
a.o = g
j.p = a
g.y = n
g.v = n
g.u = k
e.u = a
e.v = d
e.z = d
e.t = n
d.r = a
d.v = n
k.u = a
k.v = d
k.z = d
k.t = n
assert e.u.o.v.r.txt == "d"