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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.z: B = None
        self.txt = txt

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

n.p = d
n.o = d
n.w = m
n.s = b
n.t = c
b.q = d
b.x = d
b.o = i
b.r = m
i.v = d
i.p = m
i.o = g
c.x = b
e.p = j
e.y = i
e.z = i
d.s = b
d.z = b
d.u = c
j.p = e
j.y = k
j.z = k
m.p = d
m.o = d
m.w = n
m.s = b
m.t = c
k.v = d
k.p = n
k.o = i
g.v = d
g.p = m
g.o = k
assert d.u.x.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: F = None
        self.w: A = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.z: B = None
        self.txt = txt

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

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