class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.r: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.s: B = None
        self.t: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.s: B = None
        self.t: G = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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