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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.r: D = None
        self.q: F = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

a = A("a")
b = B("b")
i = C("i")
j = D("j")
m = E("m")
h = F("h")
l = D("l")
c = E("c")
f = C("f")
g = D("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.r: D = None
        self.q: F = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: B = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

a = A("a")
b = B("b")
i = C("i")
j = D("j")
m = E("m")
h = F("h")
l = D("l")
c = E("c")
f = C("f")
g = D("g")

a.o = f
a.y = l
a.r = l
a.u = g
b.q = i
b.s = a
b.p = a
i.q = h
i.o = a
j.w = i
j.p = a
m.v = c
m.x = b
m.p = b
m.r = j
m.q = h
m.t = i
h.x = a
h.y = b
h.q = b
h.w = g
l.w = f
l.p = a
c.v = m
c.x = b
c.p = b
c.r = g
c.q = h
c.t = i
f.q = h
f.o = a
g.w = f
g.p = a
assert l.w.o.o.o.y.p.u.w.txt == "f"