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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.p: F = None
        self.t: G = None
        self.w: D = None
        self.v: A = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.o: F = None
        self.t: F = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

i = A("i")
b = B("b")
c = C("c")
h = D("h")
d = E("d")
m = F("m")
f = G("f")
g = C("g")

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.p: F = None
        self.t: G = None
        self.w: D = None
        self.v: A = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.o: F = None
        self.t: F = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

i = A("i")
b = B("b")
c = C("c")
h = D("h")
d = E("d")
m = F("m")
f = G("f")
g = C("g")

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