class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.t: A = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

h.r = f
h.w = b
h.t = c
h.u = c
h.y = c
b.o = f
b.y = f
g.q = b
g.w = b
g.s = e
k.s = f
k.z = b
e.y = c
e.o = h
f.r = k
f.v = b
f.y = g
l.s = f
l.z = b
j.y = c
j.o = c
c.r = f
c.w = b
c.t = h
c.u = h
c.y = h
i.y = h
i.o = c
assert g.w.o.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.t: A = None
        self.u: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

h.r = f
h.w = b
h.t = c
h.u = c
h.y = c
b.o = f
b.y = f
g.q = b
g.w = b
g.s = e
k.s = f
k.z = b
e.y = c
e.o = h
f.r = k
f.v = b
f.y = g
l.s = f
l.z = b
j.y = c
j.o = c
c.r = f
c.w = b
c.t = h
c.u = h
c.y = h
i.y = h
i.o = c
assert g.w.o.y.s.y.txt == "c"