class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: H = None
        self.t: E = None
        self.x: G = None
        self.o: H = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

i = A("i")
j = B("j")
b = C("b")
d = D("d")
h = E("h")
l = F("l")
g = G("g")
f = H("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: H = None
        self.t: E = None
        self.x: G = None
        self.o: H = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

i = A("i")
j = B("j")
b = C("b")
d = D("d")
h = E("h")
l = F("l")
g = G("g")
f = H("f")

i.r = j
i.p = l
j.p = g
j.o = g
j.y = g
j.u = g
b.w = j
b.x = f
b.v = h
d.u = l
d.p = l
d.w = f
d.o = f
d.t = h
d.x = g
d.s = j
h.x = d
h.p = f
l.r = g
l.v = f
l.z = b
g.z = l
f.u = d
assert d.t.p.u.txt == "d"