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

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.u: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: C = None
        self.r: G = None
        self.u: D = None
        self.w: D = None
        self.txt = txt

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

b = A("b")
h = B("h")
d = C("d")
j = D("j")
m = E("m")
l = F("l")
c = G("c")
g = E("g")
k = C("k")
a = E("a")

b.p = j
b.u = j
b.o = j
b.v = k
b.r = d
h.p = b
h.z = l
h.y = a
d.y = h
j.z = h
j.p = l
j.r = l
j.u = k
j.y = m
m.x = d
m.o = h
m.y = k
l.o = b
l.v = k
l.r = c
l.u = j
l.w = j
c.v = j
g.x = k
g.o = h
g.y = d
k.y = h
a.x = d
a.o = h
a.y = k
assert d.y.y.x.y.p.v.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.v: C = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.u: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: C = None
        self.r: G = None
        self.u: D = None
        self.w: D = None
        self.txt = txt

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

b = A("b")
h = B("h")
d = C("d")
j = D("j")
m = E("m")
l = F("l")
c = G("c")
g = E("g")
k = C("k")
a = E("a")

b.p = j
b.u = j
b.o = j
b.v = k
b.r = d
h.p = b
h.z = l
h.y = a
d.y = h
j.z = h
j.p = l
j.r = l
j.u = k
j.y = m
m.x = d
m.o = h
m.y = k
l.o = b
l.v = k
l.r = c
l.u = j
l.w = j
c.v = j
g.x = k
g.o = h
g.y = d
k.y = h
a.x = d
a.o = h
a.y = k
assert d.y.y.x.y.p.v.y.p.txt == "b"