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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

c = A("c")
d = B("d")
l = C("l")
m = D("m")
e = E("e")
j = F("j")
h = G("h")
n = B("n")
f = B("f")

c.w = j
c.v = e
c.u = e
d.y = e
d.r = m
d.p = m
d.o = l
d.w = l
d.s = n
d.v = c
l.u = f
l.s = f
l.r = h
l.x = e
m.s = e
e.t = j
e.v = j
e.y = j
e.u = d
j.r = l
h.r = l
h.q = m
h.y = j
h.o = c
n.y = e
n.r = m
n.p = m
n.o = l
n.w = l
n.s = f
n.v = c
f.y = e
f.r = m
f.p = m
f.o = l
f.w = l
f.s = n
f.v = c
assert n.y.y.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

c = A("c")
d = B("d")
l = C("l")
m = D("m")
e = E("e")
j = F("j")
h = G("h")
n = B("n")
f = B("f")

c.w = j
c.v = e
c.u = e
d.y = e
d.r = m
d.p = m
d.o = l
d.w = l
d.s = n
d.v = c
l.u = f
l.s = f
l.r = h
l.x = e
m.s = e
e.t = j
e.v = j
e.y = j
e.u = d
j.r = l
h.r = l
h.q = m
h.y = j
h.o = c
n.y = e
n.r = m
n.p = m
n.o = l
n.w = l
n.s = f
n.v = c
f.y = e
f.r = m
f.p = m
f.o = l
f.w = l
f.s = n
f.v = c
assert n.y.y.r.r.txt == "h"